home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / wavepl / waveplt.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-11-07  |  7.7 KB  |  256 lines

  1. VERSION 2.00
  2. Begin Form waveplot 
  3.    Caption         =   "Waveform Plot R & D Project"
  4.    ClientHeight    =   4500
  5.    ClientLeft      =   1995
  6.    ClientTop       =   1950
  7.    ClientWidth     =   4815
  8.    ClipControls    =   0   'False
  9.    Height          =   5190
  10.    Icon            =   WAVEPLT.FRX:0000
  11.    Left            =   1935
  12.    LinkTopic       =   "Form1"
  13.    ScaleHeight     =   4500
  14.    ScaleWidth      =   4815
  15.    Top             =   1320
  16.    Width           =   4935
  17.    Begin Frame Frame1 
  18.       BackColor       =   &H00C0C0C0&
  19.       Caption         =   "Use Play w Timeclock on menubar also"
  20.       Height          =   1215
  21.       Left            =   600
  22.       TabIndex        =   4
  23.       Top             =   3000
  24.       Width           =   3495
  25.       Begin CommandButton cmdstoploop 
  26.          Caption         =   "Stop Loop"
  27.          Height          =   435
  28.          Left            =   2160
  29.          TabIndex        =   8
  30.          Top             =   720
  31.          Width           =   1215
  32.       End
  33.       Begin CommandButton cmdsoundloop 
  34.          Caption         =   "&Loop"
  35.          Height          =   435
  36.          Left            =   2160
  37.          TabIndex        =   7
  38.          Top             =   240
  39.          Width           =   1215
  40.       End
  41.       Begin CommandButton Command1 
  42.          Caption         =   "Full Screen Plot"
  43.          Enabled         =   0   'False
  44.          Height          =   435
  45.          Left            =   120
  46.          TabIndex        =   6
  47.          Top             =   240
  48.          Width           =   1935
  49.       End
  50.       Begin CommandButton cmd_playwave 
  51.          Caption         =   "Play  wo timeclock"
  52.          Enabled         =   0   'False
  53.          Height          =   435
  54.          Left            =   120
  55.          TabIndex        =   5
  56.          Top             =   720
  57.          Width           =   1935
  58.       End
  59.    End
  60.    Begin PictureBox picwavetime 
  61.       AutoRedraw      =   -1  'True
  62.       BackColor       =   &H00000000&
  63.       FillColor       =   &H00C0C000&
  64.       FontBold        =   -1  'True
  65.       FontItalic      =   0   'False
  66.       FontName        =   "MS Sans Serif"
  67.       FontSize        =   13.5
  68.       FontStrikethru  =   0   'False
  69.       FontUnderline   =   0   'False
  70.       ForeColor       =   &H0000FFFF&
  71.       Height          =   420
  72.       Left            =   1800
  73.       ScaleHeight     =   390
  74.       ScaleWidth      =   1185
  75.       TabIndex        =   3
  76.       Top             =   2475
  77.       Width           =   1215
  78.    End
  79.    Begin PictureBox pic_stats 
  80.       AutoRedraw      =   -1  'True
  81.       BackColor       =   &H00000000&
  82.       FillColor       =   &H0000FFFF&
  83.       ForeColor       =   &H0000FFFF&
  84.       Height          =   900
  85.       Left            =   120
  86.       ScaleHeight     =   870
  87.       ScaleWidth      =   4545
  88.       TabIndex        =   2
  89.       Top             =   1560
  90.       Width           =   4575
  91.    End
  92.    Begin CommonDialog FileOpenDialog 
  93.       DialogTitle     =   "Open Wave File"
  94.       Filename        =   "*.wav"
  95.       Filter          =   "Wave Audio|*.wav"
  96.       Left            =   4200
  97.       Top             =   2640
  98.    End
  99.    Begin PictureBox Picture1 
  100.       ClipControls    =   0   'False
  101.       ForeColor       =   &H0000FF00&
  102.       Height          =   1215
  103.       Left            =   120
  104.       ScaleHeight     =   1185
  105.       ScaleWidth      =   4545
  106.       TabIndex        =   0
  107.       Top             =   240
  108.       Width           =   4575
  109.       Begin Shape Shape1 
  110.          BackStyle       =   1  'Opaque
  111.          BorderStyle     =   0  'Transparent
  112.          FillColor       =   &H000000FF&
  113.          FillStyle       =   0  'Solid
  114.          Height          =   100
  115.          Left            =   10
  116.          Top             =   1100
  117.          Width           =   50
  118.       End
  119.    End
  120.    Begin Label Label3 
  121.       Caption         =   "Stretch form wider,click replot for more detailed view."
  122.       Height          =   255
  123.       Left            =   0
  124.       TabIndex        =   1
  125.       Top             =   0
  126.       Width           =   4695
  127.    End
  128.    Begin Menu FileMenu 
  129.       Caption         =   "File"
  130.       Begin Menu OpenOption 
  131.          Caption         =   "Open Wave File"
  132.       End
  133.       Begin Menu QuitOption 
  134.          Caption         =   "Quit"
  135.       End
  136.    End
  137.    Begin Menu EffectsMenu 
  138.       Caption         =   "Replot"
  139.       Begin Menu EchoOption 
  140.          Caption         =   "Replot"
  141.       End
  142.    End
  143.    Begin Menu PlayOption 
  144.       Caption         =   "Play w Timeclock"
  145.    End
  146. Option Explicit
  147. Dim startup As Integer
  148. Dim dCURX As Single
  149. Sub cmd_playwave_Click ()
  150. Dim success As Integer
  151. 'this is an alternative to playing a wave file,rather than
  152. 'using the WaveOut procedure.No time update though
  153. success = mciexecute("play " & wavepath)
  154. End Sub
  155. Sub cmdsoundloop_Click ()
  156. 'loop a wave file
  157. Dim success As Integer, params As Integer
  158. params = SND_ASYNC Or SND_LOOP
  159. success = sndPlaySound(wavepath, params)
  160. End Sub
  161. Sub cmdstoploop_Click ()
  162. Dim success As Integer, params As Integer
  163. 'stops the looped wave file
  164. 'will stop playing loop when current wave is done,will not cause an
  165. 'immediate stop
  166. params = params And Not SND_LOOP
  167. success = sndPlaySound(wavepath, params)
  168. End Sub
  169. Sub Command1_Click ()
  170.     'plot the wave using the full screen size
  171.     Dim dummy As Integer
  172.     frm_big.Show
  173.     screen.MousePointer = 11
  174.     PlayOption.Enabled = False
  175.     dummy = PlotaWave(hWaveSampleData, frm_big, 2)
  176.     PlayOption.Enabled = True
  177.     screen.MousePointer = 0
  178.     PlayOption_Click
  179. End Sub
  180. Sub EchoOption_Click ()
  181.     Dim dummy As Integer
  182.     screen.MousePointer = 11
  183.     PlayOption.Enabled = False
  184.     dummy = PlotaWave(hWaveSampleData, Me, 1)
  185.     PlayOption.Enabled = True
  186.     screen.MousePointer = 0
  187. End Sub
  188. Sub Form_Load ()
  189. Dim cx As Single, curY As Single
  190. Me.Left = (screen.Width - Me.Width) / 2
  191. Me.Top = (screen.Height - Me.Height) / 2
  192. startup = True
  193. picwavetime.Print "00:00.00"
  194. PlayOption.Enabled = False
  195. EchoOption.Enabled = False
  196. EffectsMenu.Enabled = False
  197. Picture1.ScaleHeight = 700
  198. Picture1.DrawWidth = 2
  199. Picture1.CurrentX = 0
  200. Picture1.CurrentY = 2000
  201. Picture1.BackColor = QBColor(0)
  202. 'Red center line(base line)
  203. Picture1.Line (cx, 2000)-(Picture1.ScaleWidth, 2000), QBColor(4)
  204. End Sub
  205. Sub Form_Resize ()
  206. If startup Then
  207.    startup = False
  208.    Exit Sub
  209. End If
  210. Picture1.Left = 0
  211. Picture1.Width = Me.ScaleWidth
  212. label3.Width = Me.ScaleWidth
  213. frame1.Left = (ScaleWidth - frame1.Width) / 2
  214. pic_stats.Left = (ScaleWidth - pic_stats.Width) / 2
  215. picwavetime.Left = (ScaleWidth - picwavetime.Width) / 2
  216. End Sub
  217. Sub Form_Unload (Cancel As Integer)
  218.     CloseWavePlay
  219. End Sub
  220. Sub OpenOption_Click ()
  221.     Dim success As Integer
  222.     PlayOption.Enabled = False
  223.     EchoOption.Enabled = False
  224.     EffectsMenu.Enabled = False
  225.     FileOpenDialog.Action = 1
  226.     wavepath = FileOpenDialog.Filename
  227.     'check wavefile,if not a format tag of 1 then do not plot
  228.     If Not checkformat((FileOpenDialog.Filename)) Then
  229.        Exit Sub
  230.     End If
  231.     If OpenWaveFile(FileOpenDialog.Filename) Then
  232.         PlayOption.Enabled = True
  233.         
  234.         EchoOption.Enabled = True
  235.         EffectsMenu.Enabled = True
  236.         command1.Enabled = True
  237.         cmd_playwave.Enabled = True
  238.         
  239.         picwavetime.Cls
  240.         picwavetime.Print "00:00.00"
  241.         
  242.         'plot the wave if a format tag of 1
  243.           EchoOption_Click
  244.         
  245.     End If
  246. End Sub
  247. Sub PlayOption_Click ()
  248.     'play the wave
  249.     Dim dummy As Integer
  250.     dummy = WaveOut()
  251. End Sub
  252. Sub QuitOption_Click ()
  253.     Unload waveplot
  254.     End
  255. End Sub
  256.